#include "stdafx.h"
#include "InteractiveCmd.h"
#include "CmdMgr.h"

using namespace Base::CmdFwk;

InteractiveCmd::InteractiveCmd(const void* id)
    : Command(id)
    , m_state(eNormal)
{
}

InteractiveCmd::~InteractiveCmd()
{
}

bool
InteractiveCmd::isInteractiveCmd() const
{
    return true;
}

InteractiveCmd::EState
InteractiveCmd::state() const
{
    return m_state;
}

void
InteractiveCmd::state(EState state)
{
    if (m_state != state)
    {
        if (   eNormal == m_state
            && eActive ==   state)
        {
            onActivate();
        }
        else if (   eActive == m_state
                 && eNormal ==   state)
        {
            onDeactivate();
        }
        else
        {
            assert(false);
        }

        m_state = state;
    }
}

void
InteractiveCmd::onActivate()
{
}

void
InteractiveCmd::onDeactivate()
{
}